var chart_mid = echarts.init(document.getElementById('mid'), 'macarons', {renderer: 'canvas'});
var chart_left1 = echarts.init(document.getElementById('left1'), 'macarons', {renderer: 'canvas'});
var chart_left3 = echarts.init(document.getElementById('left3'), 'macarons', {renderer: 'canvas'});
var chart_right2 = echarts.init(document.getElementById('right2'), 'macarons', {renderer: 'canvas'});
var chart_right1 = echarts.init(document.getElementById('right1'), 'macarons', {renderer: 'canvas'});

var map_3d_option = {
        "label": {
            "show": true,
            "formatter": function(data){return data.name + ":" + data.value[2]}
        },
}
chart_mid.setOption(map_3d_option);
function check_in_map(){
	u = "/checkMap"
	$.ajax({
		type: "GET",
		url: u,
		dataType: "json",
		success: function (result) {
			chart_mid.setOption(result);
			chart_mid.setOption(map_3d_option);
			chart_mid.setOption(map_3d_option);
			chart_mid.setOption(map_3d_option);
		}
	});
}


function check_in_line_staff(){
	u = "/checkLineStaff"
	$.ajax({
		type: "GET",
		url: u,
		dataType: "json",
		success: function (result) {
			chart_left1.setOption(result);
		}
	});
}


function checkLineGrades(){
	u = "/checkLineGrades"
	$.ajax({
		type: "GET",
		url: u,
		dataType: "json",
		success: function (result) {
			chart_right1.setOption(result);
		}
	});
}
function checkFunnel(){
	u = "/checkFunnel"
	$.ajax({
		type: "GET",
		url: u,
		dataType: "json",
		success: function (result) {
			chart_right2.setOption(result);
		}
	});
}
function checkPie(){
	u = "/checkPie"
	$.ajax({
		type: "GET",
		url: u,
		dataType: "json",
		success: function (result) {
			chart_left3.setOption(result);
		}
	});
}

function getStuSignData(){
	u = "/stuSignData"
	$.ajax({
		type: "GET",
		url: u,
		dataType: "json",
		success: function (result) {
            $("#stuSignInData2019").html(result['2019']);
            $("#stuSignInData2018").html(result['2018']);
            $("#stuSignInData2017").html(result['2017']);
		}
	});
}

check_in_map()
check_in_line_staff()
checkFunnel()
checkLineGrades()
checkPie()
getStuSignData()